package com.qfedu.dtboot.service.impl;

import com.qfedu.dtboot.dao.ScheduleJobDao;
import com.qfedu.dtboot.entity.ScheduleJob;
import com.qfedu.dtboot.entity.ScheduleJobLog;
import com.qfedu.dtboot.dao.ScheduleJobLogDao;
import com.qfedu.dtboot.service.ScheduleJobLogService;
import com.qfedu.dtboot.util.DataGridResult;
import com.qfedu.dtboot.util.Query;
import com.qfedu.dtboot.util.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 定时任务日志(ScheduleJobLog)表服务实现类
 *
 * @author ykx
 * @since 2022-09-27 13:04:17
 */
@Service
public class ScheduleJobLogServiceImpl implements ScheduleJobLogService {

    @Autowired
    private ScheduleJobLogDao scheduleJobLogDao;

    @Override
    public void save(ScheduleJobLog scheduleJobLog) {
        scheduleJobLogDao.insert(scheduleJobLog);
    }

    @Override
    public DataGridResult queryJobLog(Map<String, Object> map) {
        Query query = new Query(map);
        List<ScheduleJobLog> rows = scheduleJobLogDao.queryAllByLimit(query);
        Integer count = scheduleJobLogDao.queryCount();
        return new DataGridResult(rows,count);
    }
}
